
/**
 * @file    WebStorage.h
 * @brief   
 * @date    2005-03-15 15:55:23
 * @author  GengYong (gengyong@gmail.com)
 *
 */

#ifndef WEBWINDOW_HEADER_WEBSTORAGE_H
#define WEBWINDOW_HEADER_WEBSTORAGE_H
//----------------------------------------------------------

#include "WebWindowImpl.h"

namespace xessage_private {
	class WebStorage:public IStorage
	{
	public:
		WebStorage(WebWindowImpl * app);
		virtual ~WebStorage();
	public:
		virtual HRESULT	STDMETHODCALLTYPE QueryInterface(REFIID riid,  LPVOID * ppvObj);
		virtual ULONG	STDMETHODCALLTYPE AddRef();
		virtual ULONG	STDMETHODCALLTYPE Release();
		virtual HRESULT	STDMETHODCALLTYPE CreateStream(const WCHAR *pwcsName, DWORD grfMode, DWORD reserved1, DWORD reserved2, IStream **ppstm);
		virtual HRESULT	STDMETHODCALLTYPE OpenStream(const WCHAR * pwcsName, void *reserved1, DWORD grfMode, DWORD reserved2, IStream **ppstm);
		virtual HRESULT	STDMETHODCALLTYPE CreateStorage(const WCHAR *pwcsName, DWORD grfMode, DWORD reserved1, DWORD reserved2, IStorage **ppstg);
		virtual HRESULT	STDMETHODCALLTYPE OpenStorage(const WCHAR * pwcsName, IStorage * pstgPriority, DWORD grfMode, SNB snbExclude, DWORD reserved, IStorage **ppstg);
		virtual HRESULT	STDMETHODCALLTYPE CopyTo(DWORD ciidExclude, IID const *rgiidExclude, SNB snbExclude,IStorage *pstgDest);
		virtual HRESULT	STDMETHODCALLTYPE MoveElementTo(const OLECHAR *pwcsName,IStorage * pstgDest, const OLECHAR *pwcsNewName, DWORD grfFlags);
		virtual HRESULT STDMETHODCALLTYPE Commit(DWORD grfCommitFlags);
		virtual HRESULT STDMETHODCALLTYPE Revert();
		virtual HRESULT STDMETHODCALLTYPE EnumElements(DWORD reserved1, void * reserved2, DWORD reserved3, IEnumSTATSTG ** ppenum);
		virtual HRESULT STDMETHODCALLTYPE DestroyElement(const OLECHAR *pwcsName);
		virtual HRESULT STDMETHODCALLTYPE RenameElement(const WCHAR *pwcsOldName, const WCHAR *pwcsNewName);
		virtual HRESULT STDMETHODCALLTYPE SetElementTimes(const WCHAR *pwcsName, FILETIME const *pctime, FILETIME const *patime, FILETIME const *pmtime);
		virtual HRESULT STDMETHODCALLTYPE SetClass(REFCLSID clsid);
		virtual HRESULT STDMETHODCALLTYPE SetStateBits(DWORD grfStateBits, DWORD grfMask);
		virtual HRESULT STDMETHODCALLTYPE Stat(STATSTG * pstatstg, DWORD grfStatFlag);
	private:
		WebWindowImpl *	m_appImpl;
		LONG			m_refCount;
	};
}

//----------------------------------------------------------
#endif	//ifndef WEBWINDOW_HEADER_WEBSTORAGE_H